package com.meevle.commands {
	
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.meevle.business.SetDelegate;
	import com.meevle.error.ErrorHandler;
	import com.meevle.model.ViewModelLocator;
	import com.meevle.events.RemoveSlotFromSetEvent;
	import com.meevle.vo.SetVO;
	import com.meevle.vo.SlotVO;
	
	import mx.rpc.IResponder;
	import mx.rpc.events.FaultEvent;
	
	public class RemoveSlotFromSetCommand implements ICommand, IResponder {
		
		public function RemoveSlotFromSetCommand() {
			
		}
		
		// ICommand interface method
		public function execute(event:CairngormEvent):void {
			var removeSlotFromSetEvent:RemoveSlotFromSetEvent = event as RemoveSlotFromSetEvent;
			var slot:SlotVO = removeSlotFromSetEvent.slot;
			var m_set:SetVO = removeSlotFromSetEvent.m_set;
			var delegate:SetDelegate = new SetDelegate(this);
			delegate.removeSlotFromSet(slot, m_set);
		}
		
		//IResponder interface methods
		public function result(event:Object) : void {
				// DO NOTHING
		}
		
		public function fault(event:Object) : void {
			ErrorHandler.getInstance().handleError(event as FaultEvent);
		}	
	}
}